package com.jade;

import lombok.extern.slf4j.Slf4j;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

import java.nio.charset.StandardCharsets;

@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@Slf4j
@MapperScan("com.jade.**.mapper")
@EnableScheduling 
public class JADEApplication {

    public static void main(String[] args) {
        SpringApplication.run(JADEApplication.class, args);
        log.info("(♥◠‿◠)ﾉﾞ  嘉德(JADE)启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                "       .----.   .----.--.      \n" +
                "       ||  ||   ||  || -- \\\\. \n" +
                "       ||  ||   ||  ||    --.  \n" +
                "       ||  ||   ||  ||     --. \n" +
                "       ||  ||   ||  ||     --. \n" +
                "       ||  ||   ||  ||     --. \n" +
                " '-    //  //   ||  ||    --.  \n" +
                "  \\'-     //    ||  || -- //'\n" +
                "    `'-' `       '----'--'     ");
    }

    @Bean
    public RestTemplate restTemplate() {
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
        restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
        return restTemplate;
    }
}
